/**
 * 
 */
package bud.util;

import java.util.Vector;

/**
 * @author zhangwq
 */

@SuppressWarnings("unchecked")
public class Resource extends Vector
{
    private static final long serialVersionUID = 1L;

    public Object get(String className)
    {
        return this.get(className, 0);
    }

    public Object get(String className, int start)
    {
        int i = 0;
        Object tReturn = null;
        if (start < 0)
        {
            start = 0;
        }
        try
        {
            for (i = start; i < this.size(); i++)
            {
                if (this.get(i) == null)
                {
                    continue;
                }
                String rscName =
                    this.get(i).getClass().getSimpleName().toUpperCase();
                className = className.toUpperCase();
                if (rscName.equals(className))
                {
                    tReturn = this.get(i);
                    break;
                }
            }
        }catch (Exception ex)
        {
            tReturn = null;
        }
        return tReturn;
    }
}
